package iwpl.project.entities;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Roles entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Roles")
public class Roles implements java.io.Serializable {

	// Fields

	private Integer id;
	private String roleName;
	private String description;
	private Boolean active;
	private Set<Accounts> accountses = new HashSet<Accounts>(0);
	private Set<RoleDetails> roleDetailses = new HashSet<RoleDetails>(0);

	// Constructors

	/** default constructor */
	public Roles() {
	}

	/** minimal constructor */
	public Roles(Integer id) {
		this.id = id;
	}

	/** full constructor */
	public Roles(Integer id, String roleName, String description,
			Boolean active, Set<Accounts> accountses,
			Set<RoleDetails> roleDetailses) {
		this.id = id;
		this.roleName = roleName;
		this.description = description;
		this.active = active;
		this.accountses = accountses;
		this.roleDetailses = roleDetailses;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "RoleName")
	public String getRoleName() {
		return this.roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	@Column(name = "Description")
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "Active")
	public Boolean getActive() {
		return this.active;
	}

	public void setActive(Boolean active) {
		this.active = active;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "roles")
	public Set<Accounts> getAccountses() {
		return this.accountses;
	}

	public void setAccountses(Set<Accounts> accountses) {
		this.accountses = accountses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "roles")
	public Set<RoleDetails> getRoleDetailses() {
		return this.roleDetailses;
	}

	public void setRoleDetailses(Set<RoleDetails> roleDetailses) {
		this.roleDetailses = roleDetailses;
	}

}